package com.shop2cn.iapi.productsynces.service;

import org.json.JSONObject;

import com.ymatou.iapi.productmongosync.service.EsCall;
import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;
import com.ymttest.utils.TestDataManager;

public class ESCall extends YmatouAutoTestCall {
	private static String opurl="api/commandsync";
	
	public ESCall() {
		//super(EnvSetup.getSystemUrl("esquery"),opurl,"GET","JSON");
		super("http://productsynces.iapi.shop2cn.com/", opurl, "POST", "JSON");
		//super("http://172.17.21.19:9319/", opurl, "POST", "JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	

	public JSONObject callAndGetReturnData(int activityId,String productId,String actionType){
		
		
		return callAndGetReturnData(MapUtil.hashMap("ActivityId", activityId,"ProductId",productId,"ActionType",actionType,"TransactionId",5,"ispso",false));
	}
//
//	
//	
//	

	public static void main(String[] args) {
	//	JSONObject aa = new EsCall().callAndGetReturnData(0,"f7a5e9a8-63a4-44ce-a60a-115742208857","ModifyProduct");
		System.out.print(TestDataManager.getRandomIntNum(5));
		new EsCall().callAndGetReturnData(MapUtil.hashMap("ProductId","32e12c95-c1e9-44b0-8fca-9e1766e99adb","ActionType","SyncLiveActivityProduct","TransactionId",TestDataManager.getRandomIntNum(5)));
	}
}
